package pers.xx.sbm.service.serviceImpl;

import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import pers.xx.sbm.dao.PersonDao;
import pers.xx.sbm.entity.Person;
import pers.xx.sbm.service.PersonService;

/**
 * @author ：xiexing
 * @description：TODO
 * @date ：2020/7/19 15:24
 */
@Service
public class PersonServiceImpl implements PersonService {
    @Autowired
    PersonDao personDao;

    @Override
    public Person sel(int id) {
        return personDao.Sel(id);
    }

    @Override
    public PageInfo<Person> listByPage(Person person, Integer page, Integer limit) {
        /*page = page == null ? 0 : page - 1;
        limit = limit == null ? 10 : limit;
        PageHelper.startPage(page, limit);//设置数据库分页查询的范围
        List<Person> personList = personDao.ListByPage(person, page, limit);
        PageInfo<Person> pageInfo = new PageInfo<>(personList);
        return pageInfo;*/
        return null;
    }

    @Override
    public int updatePerson(Person person) {
        return personDao.updatePerson(person);
    }
}
